package cn.lds.j367.dsbank.entity;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
public class Customer extends BaseEntity{
    private Long customerId;

    @NotBlank(message = "姓名不能为空")
    private String customerName;

    @NotBlank(message = "没有填写电话信息")
//    @Pattern(regexp = "/^1[3456789]\\d{9}$/",message = "手机号码格式不争取")
    private String telNo;

    @NotNull(message = "证件类型不明确")
    private Integer idTypeId;

    @NotBlank(message = "证件号码没有填写")
    @Pattern(regexp = "^(\\d{6})(\\d{4})(\\d{2})(\\d{2})(\\d{3})([0-9]|X)$",message = "身份证号不合法")
    private String idNo;

    @NotNull(message = "省份没有选择")
    private Integer pId;     //省份id

    @NotNull(message = "城市没有选择")
    private Integer cId;     //城市id

    @NotNull(message = "区/县 没有选择")
    private Integer tId;     //区县id

    private String princeName; //省份名
    private String cityName;   //城市名
    private String districtName; //区县名

    @NotBlank(message = "家庭住址没有填写")
    private String homeAddress;  //家庭住址


    @NotBlank(message = "公司信息没有填写")
    private String coName;       //公司名

    @NotBlank(message = "公司地址没有填写")
    private String coAddress;   //公司地址

    private Certificate ct;     //封装身份证件类型

    private String idImgUrl;        //身份证照片

    @Override
    public String toString() {
        return "Customer{" +
                "customerId=" + customerId +
                ", customerName='" + customerName + '\'' +
                ", telNo='" + telNo + '\'' +
                ", idTypeId=" + idTypeId +
                ", idNo='" + idNo + '\'' +
                ", pId=" + pId +
                ", cId=" + cId +
                ", tId=" + tId +
                ", princeName='" + princeName + '\'' +
                ", cityName='" + cityName + '\'' +
                ", districtName='" + districtName + '\'' +
                ", homeAddress='" + homeAddress + '\'' +
                ", coName='" + coName + '\'' +
                ", coAddress='" + coAddress + '\'' +
                ", ct=" + ct +
                ", idImpUrl='" + idImgUrl + '\'' +
                '}' + super.toString();
    }
}
